package com.sfh.gd.exception;

import lombok.Getter;


/**
 * 抽象项目中三类异常体系，客户端异常、服务端异常以及远程服务调用异常
 *
 */
@Getter
public abstract class AbstractException extends RuntimeException {

    public  int errorCode;

    public  String errorMessage;

    public AbstractException(String errorMessage) {
        super(errorMessage);
        this.errorCode = -1;
        this.errorMessage = errorMessage;
    }

    public AbstractException(int errorCode,String errorMessage) {
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public AbstractException(String errorMessage, Throwable throwable) {
        this(-1,errorMessage, throwable);
    }


    public AbstractException(int errorCode,String errorMessage, Throwable throwable) {
        super(throwable);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }
}